package com.zixuan.sina.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zixuan.sina.entity.Comment;
import com.zixuan.sina.entity.Role;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface RoleMapper extends BaseMapper<Role> {

    public List<Role> getRoleList(@Param("roleName") String param);
    public List<Long> getRoleListIds(@Param("roleId") String roleId);

    void deletePermission(@Param("roleId") String roleId);

    int addPermission(@Param("roleId")String roleId, @Param("permissionId") Long permissionId);

    Long getRoleById(@Param("userId")Long userId);

    int assign(@Param("userId")Long userId, @Param("roleId")Long roleId);

    void deleteRole(@Param("userId")Long userId);
}
